<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const strings = `export default {
  name: "CARD",
  version: "0.0.1",
  type: IComponentType.DRAG,

  // 组件配置
`;

    // /v\.?([0-9a-z]+(?:\.[0-9a-z]+)*)/i)[1]
    // let pattern = /^.*?v\.?(\d+(?:\.\d+[a-z]?)*)/i;
    let pattern = /"([0-9]+(?:\.[0-9a-z]+)*)"/i;
    const version = strings.match(pattern)[1]


    const res = strings.replace(version, '0.0.2')

    console.log(strings, res )
</script>
</body>
</html>